<%@ page language="java" isELIgnored="false" import="java.util.*"
	pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<!-- /*
 * @xiaozhi
 * Email:ganhongzhi@foreveross.com
 * this is 运价监控设置 Action
*/ -->
<head>
<%@ include file="/include/header.jsp"%>
<title><s:text name="monitor.settingTitle"/></title>
<link
	href="<%=request.getContextPath()%>/fare/js/ligerUI/skins/Gray/css/all.css"
	rel="stylesheet" type="text/css" />
<script type="text/javascript"
	src="<%=request.getContextPath() %>/jsFile/js_new/jquery.1.7.2.js"></script>
<script
	src="<%=request.getContextPath()%>/fare/js/ligerUI/js/core/base.js"
	type="text/javascript"></script>

<link
	href='<%=request.getContextPath()%>/fare/js/cityquery/cityquery.css'
	rel="stylesheet" type="text/css" />
<link rev="stylesheet" media="all"
	href="<%=request.getContextPath() %>/fare/css/form_style.css"
	type="text/css" rel="stylesheet">
	<script
		src="<%=request.getContextPath()%>/fare/js/ligerUI/js/core/base.js"
		type="text/javascript"></script>

	<script
		src="<%=request.getContextPath()%>/fare/js/ligerUI/js/plugins/ligerGrid.js"
		type="text/javascript"></script>
	<script
		src="<%=request.getContextPath()%>/fare/js/ligerUI/js/plugins/ligerToolBar.js"
		type="text/javascript"></script>
	<script
		src="<%=request.getContextPath()%>/fare/js/ligerUI/js/plugins/ligerResizable.js"
		type="text/javascript"></script>
	<script
		src="<%=request.getContextPath()%>/fare/js/ligerUI/js/plugins/ligerCheckBox.js"
		type="text/javascript"></script>
	<script
		src="<%=request.getContextPath()%>/fare/js/ligerUI/js/plugins/ligerDateEditor.js"
		type="text/javascript"></script>

	<script type="text/javascript"
		src="<%=request.getContextPath() %>/fare/lib/ligerUI/js/ligerui.min.js"></script>
	<script
		src="<%=request.getContextPath()%>/fare/lib/jquery/jquery.form.js"
		type="text/javascript"></script>
	<script type='text/javascript' src='<%=request.getContextPath()%>/fare/js/cityquery/citylist.js'></script>
	<script
		src="<%=request.getContextPath()%>/fare/js/ligerUI/js/plugins/ligerSpinner.js"
		type="text/javascript"></script>

<script type='text/javascript' src='<%=request.getContextPath()%>/fare/js/cityquery/querycity.js'></script>
	<script type="text/javascript"
		src="<%=request.getContextPath() %>/fare/js/datePicker/WdatePicker.js"></script>
	<script type="text/javascript"
		src="<%=request.getContextPath()%>/jsFile/multiblepicker.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath() %>/jsFile/wait/js/wait.js"></script>	

	<!-- 圆角文本框 -->
	<link href="<%=request.getContextPath() %>/fare/css/htc/htc.css"
		rel="stylesheet" type="text/css" />


	<script type="text/javascript">

//初始化航线
$(document).ready(function(){
	
	/* if($('#result').val()!=""){
		if($('#result').val()=="保存成功！"){
			$('#departcity').val('');
			$('#arrivalcity').val('');
		}
		alert($('#result').val());
		$('#result').val("");
	} */
	$('#depCity').querycity({'data':citysFlight,'tabs':labelFromcity});
	$('#arrCity').querycity({'data':citysFlight,'tabs':labelFromcity});
//	$('#departcity').querycity({'data':citysFlight,'tabs':labelFromcity,'hotList':hotList});
//	$('#arrivalcity').querycity({'data':citysFlight,'tabs':labelFromcity,'hotList':hotList});
	
	/* $("#queryDate").ligerDateEditor({
		labelWidth : 100,
		labelAlign : 'left'}
	); */
	  
});

/* 清空 数据
 */
function clearcontent(){	
	$("#depCity").val("");
	$("#arrCity").val("");
	$("#queryDate").val("");
	$("#toQueryDate").val("");
	$("#createTime").val("");
	$("#toCreateTime").val("");
	
}
/* 添加监控设置页面跳转
 */
 function add(){
		var w_w=640;
		var w_h=480;
		var iTop = (window.screen.availHeight-30-w_h)/2; //获得窗口的垂直位置;
		var iLeft = (window.screen.availWidth-10-w_w)/2; //获得窗口的水平位置;
		var url="<%=request.getContextPath() %>/freightMonitorSettingsAction!toFreightMonitorSettingsInfoJsp.action";	
		var obj={//带过去下个页面的参数数据
			//	CHENKED_FLIGHTS:CHENKED_FLIGHTS,
				pWin:window//把父窗口放过去
		};
		 window.showModalDialog(url,obj,
					'dialogHeight='+w_h+
					'px;dialogWidth='+w_w+
					'px;dialogLeft='+iLeft+
					'px;dialogTop='+iTop+
					'px;status=no;scroll=yes;resizable=no;help=no,center=yes'
					); 
}

//刷新当前页面一次
 function reurl(){
	 url = location.href; 
	 var times = url.split("?"); 
	 if(times[1] != 1){ 
	 url += "?1"; 
	 self.location.replace(url);
	 }
}
 
 function showDataAgain(){
	 reurl();
 }
/* 条件查询 数据
 */
function find(){
	
	var shwoDif=document.getElementById("share.showDifferent").value;
	if ($("#depCity").val() == '中文/拼音'){
		$("#depCity").val("");
	}
	if ($("#arrCity").val() == '中文/拼音'){
		$("#arrCity").val("");
	}
	if ($("#depCity").val() == 'City name'){
		$("#depCity").val("");
	}
	if ($("#arrCity").val() == 'City name'){
		$("#arrCity").val("");
	}
	if($.trim($("#depCity").val())!="" 
			&& $.trim($("#arrCity").val())!="" 
			&& $.trim($("#depCity").val())==$.trim($("#arrCity").val())){
		alert(shwoDif);
		return;
	}
	//FDCWait.show();
	$("#lineForm").attr("action","<%=request.getContextPath()%>/freightMonitorSettingsAction!findMonitorByConditions.action");
	$("#lineForm").submit();
	//FDCWait.show();
}
/* 删除数据
 * @id
 */
function deleteLine(id){
	var sureAlert=document.getElementById("share.sureDel").value;
	if(confirm(sureAlert))
	{ 
		$("#lineForm").attr("action","<%=request.getContextPath()%>/freightMonitorSettingsAction!delete.action?id="+id);
		$("#lineForm").submit();
	}
}
/* 改数据
 * @id
 */
function modify(id){
	
	var w_w=640;
	var w_h=480;
	var iTop = (window.screen.availHeight-30-w_h)/2; //获得窗口的垂直位置;
	var iLeft = (window.screen.availWidth-10-w_w)/2; //获得窗口的水平位置;
	var url="<%=request.getContextPath() %>/freightMonitorSettingsAction!toFreightMonitorSettingsInfoModifysJsp.action?id="+id;	
	var obj={//带过去下个页面的参数数据
		//	CHENKED_FLIGHTS:CHENKED_FLIGHTS,
			pWin:window//把父窗口放过去
	};
	 window.showModalDialog(url,obj,
				'dialogHeight='+w_h+
				'px;dialogWidth='+w_w+
				'px;dialogLeft='+iLeft+
				'px;dialogTop='+iTop+
				'px;status=no;scroll=yes;resizable=no;help=no,center=yes'
				); 
}


</script>
</head>
<body>
<%@ include file="/include/home/home_header.jsp" %>
	<jsp:include page="/pages/system/feedback/feedback.jsp"></jsp:include>

	<div class="main main_max">
		<div class="sideBar">
			<div class="box">
				<div class="location"><s:text name="share.currentL"/>：<s:text name="share.personC"/> &gt; <s:text name="monitor.setting"/></div>
			</div>
		</div>
		<div class="form_body">
			<div class="main_max">
				<div class="form_table_tltle"><s:text name="monitor.setting" /></div>
				<%-- 查询form--%>
				<form id="lineForm" action="" method="post">
					<input type="hidden" name="result" id="result" value="${result}" />
					
					<!-- internationalization   -->
					<input type="hidden" id="share.sureDel" value="<s:text name="share.sureDel"/>" />
					<input type="hidden" id="share.showDifferent" value="<s:text name="share.showDifferent"/>" />
					
					<table width="0" border="0" cellpadding="0" cellspacing="0"
						class="form_table">
						<tr>
							<td class="left"><s:text name="share.flightDate"/>:</td>
							<td colspan=2><input name="queryDate" type="text"
								id="queryDate" style="width: 100px"
								onClick="WdatePicker({dateFmt:'yyyy-MM-dd',lang:'<s:text name='forms.locale'/>'})"
								readonly="readonly" value="${queryDate }"/> <s:text name="share.to"/> <input name="toQueryDate" type="text"
								id="toQueryDate" style="width: 100px"
								onClick="WdatePicker({dateFmt:'yyyy-MM-dd',lang:'<s:text name='forms.locale'/>'})"
								readonly="readonly" value="${toQueryDate }" /></td>
						</tr>

						<tr>
							<td class="left"><s:text name="share.flightLine"/>：</td>
							<td colspan=2>
								<%-- <jsp:include page="../../inc/flightSelect.jsp"></jsp:include> --%>
								<c:if test="${language=='en_US'}">
							   			<jsp:include page="/inc/flightSelect_en_Us.jsp">
										<jsp:param value="${fromCity}" name="fromCity"/>
										<jsp:param value="${fromCityCode}" name="fromCityCode"/>
										<jsp:param value="${toCity}" name="toCity"/>
										<jsp:param value="${toCityCode}" name="toCityCode"/>
										</jsp:include>
							    </c:if>
	    						<c:if test="${language=='zh_CN' or language=='other'}">
							   			<jsp:include page="/inc/flightSelect.jsp">
										<jsp:param value="${fromCity}" name="fromCity"/>
										<jsp:param value="${fromCityCode}" name="fromCityCode"/>
										<jsp:param value="${toCity}" name="toCity"/>
										<jsp:param value="${toCityCode}" name="toCityCode"/>
										</jsp:include>
							    </c:if>
								
							</td>
						</tr>

						<tr>
							<td class="left"><s:text name="share.createT"/>：</td>
							<td><input id="createTime" name="createTime" type="text"
								style="width: 100px"
								onClick="WdatePicker({dateFmt:'yyyy-MM-dd',lang:'<s:text name='forms.locale'/>'})"
								readonly="readonly" value="${createTime}"/> <s:text name="share.to"/> <input id="toCreateTime"
								name="toCreateTime" type="text" style="width: 100px"
								onClick="WdatePicker({dateFmt:'yyyy-MM-dd',lang:'<s:text name='forms.locale'/>'})"
								readonly="readonly" value="${ toCreateTime}"/></td>
							<td>
								<!-- <div class="form_but2" style="text-align: right">
 -->
									<%-- <img src="<%=request.getContextPath() %>/fare/images/but_01.png"
										name="querybutton" id="querybutton"
										onclick="javascript:find()" />
									<img src="<%=request.getContextPath() %>/fare/images/but_02.png"
										name="cancelbutton" id="cancelbutton"
										onclick="javascript:clearcontent();" /> 
									<img src="<%=request.getContextPath() %>/fare/images/but_03.png"
										name="addbutton" id="addbutton" onclick="javascript:add();" /> --%>
									<input type="button" onclick="javascript:find();" value="" 
									class="<s:i18n name='forms'><s:text name='forms.btn01'></s:text></s:i18n>" id="querybutton"/>
									<input type="button" onclick="javascript:clearcontent();" value="" 
									class="<s:i18n name='forms'><s:text name='forms.btn02'></s:text></s:i18n>" id="cancelbutton"/>
									<input type="button" onclick="javascript:add();" value="" 
									class="<s:i18n name='forms'><s:text name='forms.btn07'></s:text></s:i18n>" id="addbutton"/>

								<!-- </div> -->

							</td>
						</tr>

					</table>

				</form>
				<div class="high_10"></div>




				<%-- 翻页form--%>
				<form id="page_form">

					<%-- 出发城市 --%>
					<input type="hidden" name="fromCity" value=""></input>
					<%-- 到达城市 --%>
					<input type="hidden" name="toCity" value=""></input>
					<%--总页码 --%>
					<input type="hidden" name="toCity" value=""></input>
					<%--当前页码 --%>
					<input type="hidden" name="pageNum" value=""></input>
					<%--数据条数 --%>
					<input type="hidden" name="toCity" value=""></input>


					<div class="form_table_tltle"><s:text name="monitor.settingT"/></div>
					<table width="0" border="0" cellspacing="0" cellpadding="0"	class="form_list" >
						<tr class="title">
							<td style="text-align: center"><s:text name="share.index"/></td>
							<td style="text-align: center"><s:text name="share.flightDate"/></td>
							<td style="text-align: center"><s:text name="share.flightLine"/></td>
							<td style="text-align: center"><s:text name="share.flighNumber"/></td>
							<td style="text-align: center"><s:text name="share.createT"/></td>
							<td style="text-align: center"><s:text name="share.operaion"/></td>
						</tr>
						<tbody id="table2">
						<c:forEach items="${volist}" var="vo" varStatus="status">
							<tr>
								<td class="line" style="text-align: center">${status.index+1}</td>
								<td class="line" style="text-align: center"><fmt:formatDate
										value="${vo.departDate}" pattern="yyyy-MM-dd " />&nbsp;</td>
								<td class="line" style="text-align: center">${vo.airLine}&nbsp;</td>
								<td class="line" style="text-align: center">${vo.flightNumber}&nbsp;</td>
								<td class="line" style="text-align: center"><fmt:formatDate
										value="${vo.opDate}" pattern="yyyy-MM-dd HH:mm:ss" />&nbsp;</td>
								<td class="line" style="text-align: center">
									<a href="#"	onclick="javascript:deleteLine(${vo.id});"><img src="<%=request.getContextPath()%>/images/del_cli.png"/></a> 
									 &nbsp;&nbsp;&nbsp;
									<a href="#" onclick="javaScript:modify(${vo.id});"><img src="<%=request.getContextPath()%>/images/update_cli.png"/></a>
								</td>
							</tr>
						</c:forEach>
						</tbody>

					</table>
					<%-- <span id="spanFirst" style="position:absolute;overflow:auto;cursor:default;left:800px">第一页</span> 
					<span id="spanPre" style="position:absolute;overflow:auto;cursor:default;left:850px">上一页</span> 
					<span id="spanNext" style="position:absolute;overflow:auto;cursor:default;left:900px">下一页</span> 
					<span id="spanLast" style="float:right;font-size:12px;">最后一页</span> 
					<span style="position:absolute;overflow:auto;cursor:default;left:720px">第</span> 
					<span id="spanPageNum" style="position:absolute;overflow:auto;cursor:default;left:730px" ></span>
					<span style="position:absolute;overflow:auto;cursor:default;left:740px">页/共</span>
					<span id="spanTotalPage" style="position:absolute;overflow:auto;cursor:default;left:765px" ></span>
					<span style="position:absolute;overflow:auto;cursor:default;left:775px">页</span> --%>
					</form>
			</div>

		</div>
	</div>

	<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
	<%@ include file="/include/home/home_footer.jsp" %> 
	<script type='text/javascript' src='<%=request.getContextPath()%>/fare/js/cityquery/querycity.js'></script>
</body>
<style type="text/css">
td {
	text-align: center;
}
</style>


</body>
</html>
<%-- <script>

/* //分页style */
var theTable = document.getElementById("table2");
var totalPage = document.getElementById("spanTotalPage");
var pageNum = document.getElementById("spanPageNum");
var spanPre = document.getElementById("spanPre");
var spanNext = document.getElementById("spanNext");
var spanFirst = document.getElementById("spanFirst");
var spanLast = document.getElementById("spanLast");
var numberRowsInTable = theTable.rows.length;
var pageSize = 10;
var page = 1;
//下一页
function next() {
    hideTable();
    currentRow = pageSize * page;
    maxRow = currentRow + pageSize;
    if (maxRow > numberRowsInTable) maxRow = numberRowsInTable;
    for (var i = currentRow; i < maxRow; i++) {
        theTable.rows[i].style.display = '';
    }
    page++;
    if (maxRow == numberRowsInTable) { nextText(); lastText(); }
    showPage();
    preLink();
    firstLink();
}
//上一页
function pre() {
    hideTable();
    page--;
    currentRow = pageSize * page;
    maxRow = currentRow - pageSize;
    if (currentRow > numberRowsInTable) currentRow = numberRowsInTable;
    for (var i = maxRow; i < currentRow; i++) {
        theTable.rows[i].style.display = '';
    }

    if (maxRow == 0) { preText(); firstText(); }
    showPage();
    nextLink();
    lastLink();
}
//第一页
function first() {
    hideTable();
    page = 1;
    for (var i = 0; i < pageSize; i++) {
        theTable.rows[i].style.display = '';
    }
    showPage();
    preText();
    nextLink();
    lastLink();
}
//最后一页
function last() {
    hideTable();
    page = pageCount();
    currentRow = pageSize * (page - 1);
    for (var i = currentRow; i < numberRowsInTable; i++) {
        theTable.rows[i].style.display = '';
    }
    showPage();
    preLink();
    nextText();
    firstLink();
}

function hideTable() {
    for (var i = 0; i < numberRowsInTable; i++) {
        theTable.rows[i].style.display = 'none';
    }
}
function showPage() {
    pageNum.innerHTML = page;
}
//总共页数
function pageCount() {
    var count = 0;
    if (numberRowsInTable % pageSize != 0) count = 1;
    return parseInt(numberRowsInTable / pageSize) + count;
}
//显示链接
function preLink() { spanPre.innerHTML = "<a href='javascript:pre();'>上一页</a>"; }
function preText() { spanPre.innerHTML = "上一页"; }
function nextLink() { spanNext.innerHTML = "<a href='javascript:next();'>下一页</a>"; }
function nextText() { spanNext.innerHTML = "下一页"; }
function firstLink() { spanFirst.innerHTML = "<a href='javascript:first();'>第一页</a>"; }
function firstText() { spanFirst.innerHTML = "第一页"; }
function lastLink() { spanLast.innerHTML = "<a href='javascript:last();'>最后一页</a>"; }
function lastText() { spanLast.innerHTML = "最后一页"; }
//隐藏表格
function hide() {
    for (var i = pageSize; i < numberRowsInTable; i++) {
        theTable.rows[i].style.display = 'none';
    }
    totalPage.innerHTML = pageCount();
    pageNum.innerHTML = '1';
    nextLink();
    lastLink();
}
hide();

</script> --%>